package com.sales.controller;

import com.sales.client.StaffSalesClient;
import org.comple.erp.utils.AjaxResult;
import org.comple.erp.utils.JwtUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
public class staffController {
    @Autowired
    private StaffSalesClient staffSalesClient;
    @RequestMapping("/selectStaff")
    public AjaxResult selectStaff(HttpServletRequest  request){
        String token = request.getHeader("Authorization");
        String companyCode = JwtUtil.getCompanyCode(token);
        return staffSalesClient.selectSaleStaff(companyCode);
    }

}
